home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection Student Program / ADC Tools Sampler CD Disk 3 1999.iso / Metrowerks CodeWarrior / Java Support / Java_Source / IFC_112 / netscape / util / Comparable.java < prev    next >
Encoding:
Text File  |  1999-05-28  |  692 b   |  19 lines  |  [TEXT/CWIE]

  1. // Comparable.java
  2. // By Ned Etcode
  3. // Copyright 1995, 1996, 1997 Netscape Communications Corp.  All rights reserved.
  4.  
  5. package netscape.util;
  6.  
  7. /** Interface implemented by objects to enable sorting algortithms to sort
  8.   * collections of homogenous instances.
  9.   */
  10. public interface Comparable {
  11.     /** Compares two objects. Returns <b>-1</b> if "this < other", returns
  12.       * <b>1</b> if "this > other", and returns <b>0</b> if "this == other".
  13.       * The other object must be the same type as this object, otherwise the
  14.       * ClassCastException is thrown.
  15.       * @exception ClassCastException The other object is not of the same type.
  16.       */
  17.     public int compareTo(Object other);
  18. }
  19.